<?
include('kofigur_db.php');

switch ($host)
{
case 'mysql':
konek_mysql($server,$username,$password,$db);
break;
case 'mssql':
konek_mssql($server,$username,$password,$db);
break;
case 'oracle':
konek_oracle($server,$username,$password,$db);
break;
case 'posgre':
konek_posgre($server,$username,$password,$db);
break;
default :
konek_mysql($server,$username,$password,$db);

}
function konek_mysql($server="",$username="",$password="",$db=""){
$cak=mysql_connect($server,$username,$password);

if($cak)
{
$cok=mysql_select_db($db);
if(!$cok)
{
die('Gak ada db nya/Apa salah nama coba cek lagi');
}
}else
{
die('Gagal Koneksi ke Serevr');
}
}
function konek_mssql(){die('database belum disupport');}
function konek_oracle(){die('database belum disupport');}
function konek_posgre(){die('database belum disupport');}
?>